<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Tabs 标签页 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.5.4">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    <link rel="preload" href="/my/assets/css/0.styles.810d4cba.css" as="style"><link rel="preload" href="/my/assets/js/app.2dbd0b81.js" as="script"><link rel="preload" href="/my/assets/js/493.009afff8.js" as="script"><link rel="preload" href="/my/assets/js/1336.5fe7d68e.js" as="script"><link rel="preload" href="/my/assets/js/1031.8d6cd2c9.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.810d4cba.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Basic</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Form</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Data</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Navigation</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/breadcrumb.html" class="sidebar-link">Breadcrumb 面包屑</a></li><li><a href="/my/element/dropdown.html" class="sidebar-link">Dropdown 下拉菜单</a></li><li><a href="/my/element/menu.html" class="sidebar-link">NavMenu 导航菜单</a></li><li><a href="/my/element/page-header.html" class="sidebar-link">PageHeader 页头</a></li><li><a href="/my/element/steps.html" class="sidebar-link">Steps 步骤条</a></li><li><a href="/my/element/tabs.html" aria-current="page" class="active sidebar-link">Tabs 标签页</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/tabs.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#选项卡样式" class="sidebar-link">选项卡样式</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#卡片化" class="sidebar-link">卡片化</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#位置" class="sidebar-link">位置</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#自定义标签页" class="sidebar-link">自定义标签页</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#动态增减标签页" class="sidebar-link">动态增减标签页</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#自定义增加标签页触发器" class="sidebar-link">自定义增加标签页触发器</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#tabs-attributes" class="sidebar-link">Tabs Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#tabs-events" class="sidebar-link">Tabs Events</a></li><li class="sidebar-sub-header"><a href="/my/element/tabs.html#tab-pane-attributes" class="sidebar-link">Tab-pane Attributes</a></li></ul></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="tabs-标签页"><a href="#tabs-标签页" class="header-anchor">#</a> Tabs 标签页</h1> <p>分隔内容上有关联但属于不同类别的数据集合。</p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <p>基础的、简洁的标签页。</p> <!----><h2 id="选项卡样式"><a href="#选项卡样式" class="header-anchor">#</a> 选项卡样式</h2> <p>选项卡样式的标签页。</p> <!----><h2 id="卡片化"><a href="#卡片化" class="header-anchor">#</a> 卡片化</h2> <p>卡片化的标签页。</p> <!----><h2 id="位置"><a href="#位置" class="header-anchor">#</a> 位置</h2> <p>可以通过 <code>tab-position</code> 设置标签的位置</p> <!----><h2 id="自定义标签页"><a href="#自定义标签页" class="header-anchor">#</a> 自定义标签页</h2> <p>可以通过具名 <code>slot</code> 来实现自定义标签页的内容</p> <!----><h2 id="动态增减标签页"><a href="#动态增减标签页" class="header-anchor">#</a> 动态增减标签页</h2> <p>增减标签页按钮只能在选项卡样式的标签页下使用</p> <!----><h2 id="自定义增加标签页触发器"><a href="#自定义增加标签页触发器" class="header-anchor">#</a> 自定义增加标签页触发器</h2> <!----><h2 id="tabs-attributes"><a href="#tabs-attributes" class="header-anchor">#</a> Tabs Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>value / v-model</td> <td>绑定值，选中选项卡的 name</td> <td>string</td> <td>—</td> <td>第一个选项卡的 name</td></tr> <tr><td>type</td> <td>风格类型</td> <td>string</td> <td>card/border-card</td> <td>—</td></tr> <tr><td>closable</td> <td>标签是否可关闭</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>addable</td> <td>标签是否可增加</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>editable</td> <td>标签是否同时可增加和关闭</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>tab-position</td> <td>选项卡所在位置</td> <td>string</td> <td>top/right/bottom/left</td> <td>top</td></tr> <tr><td>stretch</td> <td>标签的宽度是否自撑开</td> <td>boolean</td> <td>-</td> <td>false</td></tr> <tr><td>before-leave</td> <td>切换标签之前的钩子，若返回 false 或者返回 Promise 且被 reject，则阻止切换。</td> <td>Function(activeName, oldActiveName)</td> <td>—</td> <td>—</td></tr></tbody></table> <h2 id="tabs-events"><a href="#tabs-events" class="header-anchor">#</a> Tabs Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>tab-click</td> <td>tab 被选中时触发</td> <td>被选中的标签 tab 实例</td></tr> <tr><td>tab-remove</td> <td>点击 tab 移除按钮后触发</td> <td>被删除的标签的 name</td></tr> <tr><td>tab-add</td> <td>点击 tabs 的新增按钮后触发</td> <td>—</td></tr> <tr><td>edit</td> <td>点击 tabs 的新增按钮或 tab 被关闭后触发</td> <td>(targetName, action)</td></tr></tbody></table> <h2 id="tab-pane-attributes"><a href="#tab-pane-attributes" class="header-anchor">#</a> Tab-pane Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>label</td> <td>选项卡标题</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>name</td> <td>与选项卡绑定值 value 对应的标识符，表示选项卡别名</td> <td>string</td> <td>—</td> <td>该选项卡在选项卡列表中的顺序值，如第一个选项卡则为'1'</td></tr> <tr><td>closable</td> <td>标签是否可关闭</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>lazy</td> <td>标签是否延迟渲染</td> <td>boolean</td> <td>—</td> <td>false</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/steps.html" class="prev">
        Steps 步骤条
      </a></span> <span class="next"><a href="/my/element/backtop.html">
        Backtop 回到顶部
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.2dbd0b81.js" defer></script><script src="/my/assets/js/493.009afff8.js" defer></script><script src="/my/assets/js/1336.5fe7d68e.js" defer></script><script src="/my/assets/js/1031.8d6cd2c9.js" defer></script>
  </body>
</html>
